﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Binding基础
{
    /// <summary>
    /// ADO.xaml 的交互逻辑
    /// </summary>
    public partial class ADO : Window
    {
        public ADO()
        {
            InitializeComponent();
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("ID", typeof(int));
            dataTable.Columns.Add("Name", typeof(string));

            DataRow dataRow = dataTable.NewRow();
            dataRow["ID"] = 1;
            dataRow["Name"] = "22";
            dataTable.Rows.Add(dataRow);

            LS.ItemsSource = dataTable.DefaultView;
            LS.DisplayMemberPath = "ID";


        }
    }
}
